package com.angel.service.ServiceImpl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.angel.bean.ProductType;
import com.angel.mapper.ProductTypeDao;
import com.angel.service.ProductTypeService;

@Service
public class ProductTypeServiceImpl implements ProductTypeService{

    @Resource
    private ProductTypeDao productTypeDao;

    @Override
    public int insert(ProductType productType){
        return productTypeDao.insert(productType);
    }

    @Override
    public int insertSelective(ProductType productType){
        return productTypeDao.insertSelective(productType);
    }

    @Override
    public int insertList(List<ProductType> productTypes){
        return productTypeDao.insertList(productTypes);
    }

    @Override
    public int update(ProductType productType){
        return productTypeDao.update(productType);
    }

    @Override
    public ProductType findOne(ProductType productType) {
        List<ProductType> list = this.findProductType(productType);
        if (list==null || list.isEmpty()){
            return null;
        }
        return list.get(0);
    }

    @Override
    public List<ProductType> findProductType(ProductType productType) {
        return productTypeDao.findProductType(productType);
    }
}
